package com.dc.project.entity.map;

import com.dc.project.entity.po.TaskFileCommit;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TaskFileCommitMapVo
 *
 * @author chenxueli
 * @date 2025-03-10 16:37:53
 */
@Schema(title = "任务文件提交" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TaskFileCommitMapVo extends BaseMap<TaskFileCommit> implements Serializable {

    @Schema(title = "任务id")
    private Long taskId;

    @Schema(title = "详情id")
    private Long detailId;

    @Schema(title = "项目id")
    private Long itemId;

    @Schema(title = "上传的附件id")
    private Long fileId;

    @Schema(title = "上传的附件路径")
    private String filePath;

    @Schema(title = "提交类型 1=task 2=detail 3=item")
    private Integer type;

    @Schema(title = "提交的目标id")
    private Long targetId;

    @Schema(title = "解析状态 1=等待执行中 2=解析文本中 3=解析完成，压缩内容中 4=处理完成 5=解析失败 6=压缩内容失败 7=处理失败")
    private Integer status;

    @Schema(title = "解析消息")
    private String parseMessage;

    @Schema(title = "资料所属年份")
    private String year;

    @Schema(title = "资料所属类别")
    private String category;

    @Schema(title = "序号")
    private Integer sortOrder;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public TaskFileCommitMapVo(@NonNull TaskFileCommit entity) {
        super(entity);
        this.taskId = entity.getFkTaskId();
        this.detailId = entity.getFkDetailId();
        this.itemId = entity.getFkItemId();
        this.fileId = entity.getFkFileId();
        this.filePath = entity.getFilePath();
        this.type = entity.getType();
        this.targetId = entity.getFkTargetId();
        this.status = entity.getStatus();
        this.parseMessage = entity.getParseMessage();
        this.year = entity.getYear();
        this.category = entity.getCategory();
        this.sortOrder = entity.getSortOrder();
    }

}
